<template>
	<view class="insurecontent">
		<view class="insurecontentbox">
			<view class="insurecontentbox1">
				<view class="boxtitle ">
					<view class="boxtitletext">成员信息</view>
					<view class="boxtitlebg"></view>
				</view>
			</view>
			<view v-for="(item,index) in childList" :key="index" class="insurecontentbox2">
				<view class="insurecontentbox3">
					<u--form labelWidth='95' labelPosition="left" :model="item">
						<u-form-item label="姓名" borderBottom>
							<u--input disabled v-model="item.realName" border="none"></u--input>
						</u-form-item>
						<u-form-item label="电话" borderBottom>
							<u--input disabled v-model="item.realName" border="none"></u--input>
						</u-form-item>
						<u-form-item label="身份证号" borderBottom>
							<u--input disabled v-model="item.phoneNubmer" border="none"></u--input>
						</u-form-item>
						<u-form-item label="与家长关系" borderBottom>
							<u--input disabled v-model="item.phoneNubmer" border="none"></u--input>
						</u-form-item>
					</u--form>
				</view>
				<view class="heng"></view>
			</view>
		</view>
		<view class="addFamily">
			<button @click="show1=true" class="addFamilybutton">添加家人</button>
		</view>
		<u-popup closeable=true style="height:50%" :round="15" :show="show1" mode="bottom" @close="close1" @open="open1">
			<view class="insurecontentbox3">
				<view   class="boxtitle ">
					<view class="boxtitletext boxtitlebottom">添加家人</view>
					<view class="boxtitlebg"></view>
				</view>
				<u--form labelWidth='95' labelPosition="left" :model="parentList">
					<u-form-item label="姓名" borderBottom>
						<u--input  v-model="parentList.realName" border="none"></u--input>
					</u-form-item>
					<u-form-item label="电话" borderBottom>
						<u--input v-model="parentList.realName" border="none"></u--input>
					</u-form-item>
					<u-form-item label="身份证号" borderBottom>
						<u--input v-model="parentList.phoneNubmer" border="none"></u--input>
					</u-form-item>
					<u-form-item label="与家长关系" borderBottom
						@click="showSex = true;">
						<view style="color:#333" @click="show = true">{{parentList.relationship}}</view>
					</u-form-item>
				</u--form>
				<view class="addFamily1">
					<button @click="show1=false" class="addFamilybutton">完成添加</button>
				</view>
			</view>
		</u-popup>
		<u-popup :round="15" :show="show" >
			<view v-for="(item,index) in actions" :key="index" @click="relaClick(item)" class="textopen">{{item.name}}
			</view>
			<view class="textopenheng"></view>
			<view @click="show=false" class="textopentitle">取消</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		getwxJoinActivity
	} from '../../api/login.js'
	export default {
		data() {
			return {
				childList: [{
					docNumber: "", //孩子身份证
					phoneNubmer: "", //孩子手机号
					realName: "", //孩子名字
					belongId: 1, //活动id
					belongType: "02", //默认值
					participantType: "1", //1孩子
					relation: "", //与父母默认关系值
					docType: "01", //默认身份证
					isAuthorized: "1", //通知书授权
					relationship: '请选择'
				}],
				parentList: {relationship: '请选择'},
				show: false,
				show1: false,
				actions: [{
						name: '父子',
						value: '1'
					}, {
						name: '母子',
						value: '2'
					}, {
						name: '父女',
						value: '3'
					}, {
						name: '母女',
						value: '4'
					},
					{
						name: '其他',
						value: '0'
					},
				],

			}
		},
		mounted() {
			this.endInfoList = []
			// getwxJoinActivity(this.infodata).then(res => {
			// 	console.log(res);
			// })
		},
		methods: {
			open1() {
				// console.log('open');
			},
			close1() {
				this.show1 = false
				// console.log('close');
			},
			relaClick(item) {
				console.log(item);
				this.parentList.relation = item.value
				this.parentList.relationship = item.name
				this.show = false
			},
		},
		// id
		onLoad: function(option) {

		},

		onReady() {
			//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
			// this.$refs.uForm.setRules(this.rules)
		},
	}
</script>

<style lang="scss">
	.insurecontent {
		width: 100%;
		height: 100vh;
		overflow: auto;
		background-color: #F5F8FA;
	}

	.insurecontentbox {
		width: 100%;
		background-color: #fff;
		margin-top: 15rpx;
		margin-bottom: 150rpx;
	}

	.boxtitle {
		position: relative;
		width: 135rpx;
		height: 38rpx;
	}

	.boxtitletext {

		font-size: 31rpx;
		color: #333333;
		line-height: 33rpx;
		font-weight: bold;
	}

	.boxtitlebg {
		width: 135rpx;
		height: 21rpx;
		background: #5098E1;
		opacity: 0.15;
		position: absolute;
		bottom: 0;
	}

	.boxcontent {
		margin-top: 20rpx;
		width: 100%;
		height: 30rpx;
	}

	.boxcontentleft {
		float: left;
		font-size: 25rpx;
		color: #000000;
		line-height: 38rpx;
	}

	.boxcontentright {
		float: right;
		font-size: 25rpx;
		color: #000000;
		line-height: 38rpx;
		font-weight: bold;
	}

	.insurecontentbox1 {
		width: 92%;
		// height: 40rpx;
		padding: 4%;
	}

	.insurecontentbox2 {
		width: 100%;
	}

	.insurecontentbox3 {
		width: 92%;
		padding: 0 4%;
	}

	.heng {
		width: 100%;
		height: 15rpx;
		background: #F5F8FA;
	}

	.addFamily {
		width: 100%;
		height: 150rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		left: 0;
	}

	.addFamilybutton {
		width: 80%;
		height: 90rpx;
		border-radius: 45rpx;
		font-weight: bold;
		background-image: linear-gradient(to right, #449EEC 0%, #005bea 100%);
		color: #fff;
		margin-top: 20rpx;

	}
	.addFamily1{
		width: 100%;
		height: 120rpx;
	}
	.boxtitle {
		position: relative;
		width: 135rpx;
		height: 38rpx;
	}
	
	.boxtitletext {
		font-size: 31rpx;
		color: #333333;
		line-height: 33rpx;
		font-weight: bold;
	}
	
	.boxtitlebg {
		width: 135rpx;
		height: 21rpx;
		background: #5098E1;
		opacity: 0.15;
		position: absolute;
		bottom: 0;
	}
	.boxtitlebottom{
		font-size: 30rpx;
		margin-top: 30rpx;
	}
	.textopen {
		text-align: center;
		line-height: 90rpx;
		border-bottom: 1rpx solid #EBEBEB;
		width: 86%;
		margin-left: 7%;
		font-size: 29rpx;
		color: #333333;
	}
	
	.textopentitle {
		width: 100%;
		text-align: center;
		line-height: 110rpx;
		font-size: 29rpx;
		color: #333333;
	}
	
	.textopenheng {
		height: 17rpx;
		background: #CECECE;
		opacity: 0.7;
		width: 100%;
	}
</style>